'use client'
import Styles from './index.module.less'
import Layout from "@/common/layout";
import dynamic from 'next/dynamic';
import { getUserFromReq } from '@/utils/server';
const Login = dynamic(()=>import('../../common/components/login'), { ssr: false })
function List(){
    return (
        <>
            <Layout title={'登录页'}>
                <div className={Styles["cont"]}>
                    <Login type={2} />
                </div>
            </Layout>
        </>
    )
}
export async function getServerSideProps(context){
    const user = await getUserFromReq(context.req)
    if(user){
        return {
            redirect:{
                permanent: false,
                destination: '/'
            }
        }
    }
    return {
        props:{

        }
    }
}
export default List